Imports System.Data.Sqlclient

Public Class Testcheckselectie

    Dim objdataAdapter As New SqlDataAdapter()
    Dim objdatasetTekeningen As New DataSet
    Dim dvTekeningen As DataView

    Private Sub Testcheckselectie_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'DocRegData2DataSet.Tekeningen' table. You can move, or remove it, as needed.
        Me.TekeningenTableAdapter.Fill(Me.DocRegData2DataSet.Tekeningen)

        'Get your connection string (You've done this right)  
        Dim strconnectionstring As String = My.Settings.DocRegData2ConnectionString
        'Create your SqlConnection (Done)  
        Dim objconnection As New SqlConnection(strconnectionstring)
        'Create your SqlCommand (done)  
        'Dim objcommand As New SqlCommand("GetInfoTekeningen", objconnection)
        Dim objcommand As New SqlCommand("GetBladnummerNaamTekening", objconnection)
        objcommand.CommandType = CommandType.StoredProcedure

        'Set the SelectCommand property of our adapter  
        objdataAdapter.SelectCommand = objcommand

        'Fill the DataSet using the SqlDataAdapter  
        objdataAdapter.Fill(objdatasetTekeningen, "Tekeningenbedrijven")

        Dim objbindingsource As New BindingSource
        objbindingsource.DataSource = objdatasetTekeningen.Tables("Tekeningenbedrijven")

        Dim dvTekeningen As New DataView(objdatasetTekeningen.Tables("Tekeningenbedrijven"))

        dvTekeningen.Sort = "Bladnummer"

        DataGridView1.AutoGenerateColumns = True
        DataGridView1.DataSource = dvTekeningen
        DataGridView1.Columns("BedrijvenID").Visible = False

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    End Sub


End Class